/**
 * 
 */
package com.nc.delivery_project.shared.locator;

import com.google.web.bindery.requestfactory.shared.Locator;
import com.nc.delivery_project.server.domain.Department;
import com.nc.delivery_project.server.service.DepartmentService;
import com.nc.delivery_project.shared.servicelocator.DepartmentServiceLocator;



/**
 * @author NataG
 *
 */
public class DepartmentLocator  extends Locator< Department, Integer>{

	@Override
	public Department create(Class<? extends Department> arg0) {
		return new Department();
	}

	@Override
	public Department find(Class<? extends Department> arg0, Integer id) {
		return ((DepartmentService) new DepartmentServiceLocator().getInstance(null)).read(id);
	}

	@Override
	public Class<Department> getDomainType() {
		return Department.class;
	}

	@Override
	public Integer getId(Department arg0) {
		return arg0.getDeptId();
	}

	@Override
	public Class<Integer> getIdType() {
		return Integer.class;
	}

	@Override
	public Object getVersion(Department arg0) {
		return arg0.getDeptId();
	}

}
